@extends('admin.public.admin')
@section('main')
<!-- 内容 -->
<div class="mws-panel grid_8">

		<div class="mws-panel-header">
			<span><i class="icon-table"></i> 会员列表</span>
		</div>
        <div class="mws-panel-body no-padding">
            	<div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid">

               <form method="get" action="/admin/user">

            		  <div id="DataTables_Table_1_length" class="dataTables_length">

              			<label>显示
  	                        <select size="1" name="count" aria-controls="DataTables_Table_1">
  		                        <option value="10" @if(!empty($request['count']) && $request['count'] == 10) selected @endif>10</option>
  				        		<option value="20" @if(!empty($request['count']) && $request['count'] == 20) selected @endif>20</option>
  				        		<option value="30" @if(!empty($request['count']) && $request['count'] == 30) selected @endif>30</option>
  				        		<option value="50" @if(!empty($request['count']) && $request['count'] == 50) selected @endif>50</option>
  	                        </select>
              			条
              			</label>
            		  </div>

            <div class="dataTables_filter" id="DataTables_Table_1_filter">
                    <label>
                    	搜索: <input type="text" name="search" value="{{$request['search'] or ''}}" aria-controls="DataTables_Table_1">
                            <input type="submit" class="btn btn-success btn-xs" value="搜索">
                    </label>
            </div>
            </form>
            <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
                <thead>
                    <tr role="row">
		                    <th >ID</th>
		                    <th>用户名</th>
		                    <th>电话</th>
                        	<th>生日</th>
		                    <th>性别</th>
                    </tr>
                </thead>
                <?php
                  $num=0;
                ?>
            <tbody role="alert" aria-live="polite" aria-relevant="all">
            @foreach($data as $k=>$v)

            		<tr>
                      <td class="">{{++$num}}</td>
	                    <td class="">{{$v['nickname']}}</td>
	                    <td class="">{{$v['tel']}}</td>
	                    <td class="">{{date('Y-m-d H:i:s',$v['birthday'])}}</td>


          		@if($v['sex'])
					<td align="center"><span class="btn btn-success">男</span></td>

				@else
					<td align="center"><span class="btn btn-danger">女</span></td>

				@endif

                    </tr>

              @endforeach
             </tbody>
           </table>

           <!-- 分页 -->
              <div id="page_page">
                   {!! $data->appends($request)->render()!!}
              </div>
           </div>
      </div>
</div>

	@endsection